#define  _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    vector<int> singleNumber(vector<int>& nums) {
        int dif = 0;
        for (auto e : nums) dif ^= e;
        if (dif != INT_MIN) dif &= (-dif);
        int n1 = 0, n2 = 0;
        for (auto e : nums)
            if (e & dif) n1 ^= e;
            else n2 ^= e;
        return { n1, n2 };
    }
};